<html py:extends="master.xhtml" py:strip="True">
    <head py:block="head" py:strip="True">
      <title py:block="master_title">${'Login' if not signup else 'Sign Up'}</title>
    </head>

<body py:block="body" py:strip="True">
  <h1>${'Login' if not signup else 'Sign Up'}</h1>

  <div class="row">
    <div class="col-md-8 col-md-offset-1">
      <form action="${tg.url('/login_handler', params=dict(came_from=came_from, __logins=login_counter))}"
            method="post" accept-charset="UTF-8" class="form-horizontal">
        <div py:if="signup" class="form-group">
          <label class="col-sm-2 control-label">Full Name:</label>
          <div class="col-sm-10">
            <input class="form-control" type="text" name="full_name" />
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">Username:</label>
          <div class="col-sm-10">
            <input class="form-control" type="text" name="login" value="${login}"/>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">Password:</label>
          <div class="col-sm-10">
            <input class="form-control" type="password" name="password" value="" />
          </div>
        </div>
        <div py:if="signup" class="form-group">
          <label class="col-sm-2 control-label">Repeat password:</label>
          <div class="col-sm-10">
            <input class="form-control" type="password" name="password" value="" />
          </div>
        </div>
        <div py:if="not signup" class="form-group">
          <div class="col-sm-10 col-sm-offset-2">
            <div class="checkbox">
              <label>
                <input type="checkbox" name="remember" value="2252000" /> Remember me
              </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-10 col-sm-offset-2">
            <button type="submit" class="btn btn-default">
              ${'Login' if not signup else 'Sign Up'}
            </button>
          </div>
        </div>
      </form>
    </div>
  </div>
</body>
</html>
